using System.Linq.Expressions;

namespace CMS.Service;

public interface IBaseService<T> where T : class, new() {
    IQueryable<T> Get(Expression<Func<T, bool>> whereLambda);

    IQueryable<T> GetPage<TS>(int pageIndex, int pageSize, out int totalCount, Expression<Func<T, bool>> whereLambda,
                              Expression<Func<T, TS>> orderByLambda, bool isAsc);
        

    Task<bool> AddAsync(T entity);
    Task<bool> UpdateAsync(T entity);

    Task<bool> DeleteAsync(T entity);
}